//
//  FR_Labe_TableViewCell.m
//  FaceRecognition
//
//  Created by zz on 17/7/14.
//  Copyright © 2017年 Sylar. All rights reserved.
//

#import "FR_Late_TableViewCell.h"

@interface FR_Late_TableViewCell()

@property (nonatomic, strong) UILabel *classLabel;
@property (nonatomic, strong) UILabel *nameLabel;
@property (nonatomic, strong) UILabel *arriveTimeLabel;

@end

@implementation FR_Late_TableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        CGFloat w = SCREENWIDTH / 3;
    
        for (int i = 0; i < 3; i ++) {
            
            CGFloat x = w * i;
            
            UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(x, 0, w, 44)];
            label.textAlignment = NSTextAlignmentCenter;
            label.font = [UIFont systemFontOfSize:15];
            label.textColor = [UIColor colorWithHexString:@"#3b3b3b"];
            [self.contentView addSubview:label];
            label.text = @"这是label";
            if ( i == 0) {
                _classLabel = label;
                
            }else if (i == 1){
                _nameLabel = label;
            }else {
                _arriveTimeLabel = label;
            }
            
        }
        
        
        CGFloat rate = SCREENWIDTH / 375;
        _classLabel.frame = CGRectMake(15 * rate, 0, 105 * rate, 44);
        _nameLabel.frame = CGRectMake(CGRectGetMaxX(_classLabel.frame), 0, 90 * rate, 44);
        _arriveTimeLabel.frame = CGRectMake(CGRectGetMaxX(_nameLabel.frame), 0, 150 * rate, 44);
        
        UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(15, 43.5, SCREENWIDTH - 15, 0.5)];
        lineView.backgroundColor = [UIColor colorWithHexString:@"#dedede"];
        [self.contentView addSubview:lineView];
    }
    
    return self;
}

- (void)setModel:(FR_Attendance_Model *)model {
    
    _model = model;
        
    _classLabel.text = model.classname;
    _nameLabel.text = model.studentname;
    _arriveTimeLabel.text = model.zptime;

    
}

@end
